Efficiently check if a string has all unique characters without using any additional data structure